<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	xml:lang="en" lang="en">

	<ui:composition>
		
		<h:form>
		
			<rich:panel>
				<h:outputText value="Pesquisa"/>
				<h:inputText value="#{descricaoPesquisa}" style="width: 400;"/>
				<h:commandButton value="Pesquisar" action="backingBean.pesquisar"/>
			</rich:panel>
			
			<rich:dataTable value="#{backingBean.listaObjetos}"
										  var="objeto"
										  rows="10"
										  id="tabelaPesquisa"
										  width="100%">
				
				<!--  COLUNA : ACOES -->
				<rich:column width="20px;">
				
					<f:facet name="header">
						<h:outputText value="Ações" />
					</f:facet>

					<a4j:commandLink ajaxSingle="true" id="selectLink" oncomplete="#{rich:component('selectLink')}.show()">
					
						<h:graphicImage value="../../imagens/select.gif" style="border: 0;" />
						<f:setPropertyActionListener target="#{backingBean.objetoSelecionado}" value="#{objeto}" />
						
					</a4j:commandLink>
					<rich:toolTip for="selectLink" value="Selecionar"/>

				</rich:column>
				
				<rich:column>
					<f:facet name="header">
						<h:outputText value="Descrição"/>
					</f:facet>
					
					<h:outputText value="#{painelPesquisa.objetoSelecionado[]}"/>
					
				</rich:column>

			</rich:dataTable>
		
		</h:form>
		
	</ui:composition>

</html>
